<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
<meta name="generator" content="Doxygen 1.8.13"/>
<meta name="viewport" content="width=device-width, initial-scale=1"/>
<title>lwIP: src/core/dns.c File Reference</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="dynsections.js"></script>
<link href="navtree.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="resize.js"></script>
<script type="text/javascript" src="navtreedata.js"></script>
<script type="text/javascript" src="navtree.js"></script>
<script type="text/javascript">
  $(document).ready(initResizable);
</script>
<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="search/searchdata.js"></script>
<script type="text/javascript" src="search/search.js"></script>
<link href="doxygen.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
 <tbody>
 <tr style="height: 56px;">
  <td id="projectalign" style="padding-left: 0.5em;">
   <div id="projectname">lwIP
   &#160;<span id="projectnumber">2.1.2</span>
   </div>
   <div id="projectbrief">Lightweight IP stack</div>
  </td>
 </tr>
 </tbody>
</table>
</div>
<!-- end header part -->
<!-- Generated by Doxygen 1.8.13 -->
<script type="text/javascript">
var searchBox = new SearchBox("searchBox", "search",false,'Search');
</script>
<script type="text/javascript" src="menudata.js"></script>
<script type="text/javascript" src="menu.js"></script>
<script type="text/javascript">
$(function() {
  initMenu('',true,false,'search.php','Search');
  $(document).ready(function() { init_search(); });
});
</script>
<div id="main-nav"></div>
</div><!-- top -->
<div id="side-nav" class="ui-resizable side-nav-resizable">
  <div id="nav-tree">
    <div id="nav-tree-contents">
      <div id="nav-sync" class="sync"></div>
    </div>
  </div>
  <div id="splitbar" style="-moz-user-select:none;" 
       class="ui-resizable-handle">
  </div>
</div>
<script type="text/javascript">
$(document).ready(function(){initNavTree('dns_8c.html','');});
</script>
<div id="doc-content">
<!-- window showing the filter options -->
<div id="MSearchSelectWindow"
     onmouseover="return searchBox.OnSearchSelectShow()"
     onmouseout="return searchBox.OnSearchSelectHide()"
     onkeydown="return searchBox.OnSearchSelectKey(event)">
</div>

<!-- iframe showing the search results (closed by default) -->
<div id="MSearchResultsWindow">
<iframe src="javascript:void(0)" frameborder="0" 
        name="MSearchResults" id="MSearchResults">
</iframe>
</div>

<div class="header">
  <div class="summary">
<a href="#nested-classes">Data Structures</a> &#124;
<a href="#define-members">Macros</a> &#124;
<a href="#func-members">Functions</a>  </div>
  <div class="headertitle">
<div class="title">dns.c File Reference</div>  </div>
</div><!--header-->
<div class="contents">
<div class="textblock"><code>#include &quot;<a class="el" href="opt_8h.html">lwip/opt.h</a>&quot;</code><br />
<code>#include &quot;<a class="el" href="def_8h.html">lwip/def.h</a>&quot;</code><br />
<code>#include &quot;<a class="el" href="udp_8h.html">lwip/udp.h</a>&quot;</code><br />
<code>#include &quot;<a class="el" href="mem_8h.html">lwip/mem.h</a>&quot;</code><br />
<code>#include &quot;<a class="el" href="memp_8h.html">lwip/memp.h</a>&quot;</code><br />
<code>#include &quot;<a class="el" href="dns_8h.html">lwip/dns.h</a>&quot;</code><br />
<code>#include &quot;<a class="el" href="prot_2dns_8h.html">lwip/prot/dns.h</a>&quot;</code><br />
<code>#include &lt;string.h&gt;</code><br />
</div><table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="nested-classes"></a>
Data Structures</h2></td></tr>
<tr class="memitem:"><td class="memItemLeft" align="right" valign="top">struct &#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="structdns__query.html">dns_query</a></td></tr>
<tr class="separator:"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:"><td class="memItemLeft" align="right" valign="top">struct &#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="structdns__answer.html">dns_answer</a></td></tr>
<tr class="separator:"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:"><td class="memItemLeft" align="right" valign="top">struct &#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="structdns__table__entry.html">dns_table_entry</a></td></tr>
<tr class="separator:"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:"><td class="memItemLeft" align="right" valign="top">struct &#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="structdns__req__entry.html">dns_req_entry</a></td></tr>
<tr class="separator:"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table><table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="define-members"></a>
Macros</h2></td></tr>
<tr class="memitem:a9209c204996270af5cfdfd6e391267a1"><td class="memItemLeft" align="right" valign="top">#define&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="dns_8c.html#a9209c204996270af5cfdfd6e391267a1">DNS_RAND_TXID</a>&#160;&#160;&#160;<a class="el" href="group__compiler__abstraction.html#ga77370c377781ee7489e30eaf772ea05a">LWIP_RAND</a></td></tr>
<tr class="separator:a9209c204996270af5cfdfd6e391267a1"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a97f3b0c56aeee091fdf2f07faf864ce0"><td class="memItemLeft" align="right" valign="top">#define&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="dns_8c.html#a97f3b0c56aeee091fdf2f07faf864ce0">DNS_PORT_ALLOWED</a>(port)&#160;&#160;&#160;((port) &gt;= 1024)</td></tr>
<tr class="separator:a97f3b0c56aeee091fdf2f07faf864ce0"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a7f5553dc4a0d2bf99ba1282a86df31e2"><td class="memItemLeft" align="right" valign="top">#define&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="dns_8c.html#a7f5553dc4a0d2bf99ba1282a86df31e2">DNS_MAX_TTL</a>&#160;&#160;&#160;604800</td></tr>
<tr class="separator:a7f5553dc4a0d2bf99ba1282a86df31e2"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table><table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="func-members"></a>
Functions</h2></td></tr>
<tr class="memitem:adb31c3b6180773bd11f914c327f209cf"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="dns_8c.html#adb31c3b6180773bd11f914c327f209cf">dns_init</a> (void)</td></tr>
<tr class="separator:adb31c3b6180773bd11f914c327f209cf"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:gaf66c5d8273f83cdc2cdd8911fb68d584"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__dns.html#gaf66c5d8273f83cdc2cdd8911fb68d584">dns_setserver</a> (u8_t numdns, const <a class="el" href="group__ipaddr.html#ga16ef96d6cde029029bbf47fee35fd67a">ip_addr_t</a> *dnsserver)</td></tr>
<tr class="separator:gaf66c5d8273f83cdc2cdd8911fb68d584"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:gad02111a6b26b93f1c3580d5f41a59af3"><td class="memItemLeft" align="right" valign="top">const <a class="el" href="group__ipaddr.html#ga16ef96d6cde029029bbf47fee35fd67a">ip_addr_t</a> *&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__dns.html#gad02111a6b26b93f1c3580d5f41a59af3">dns_getserver</a> (u8_t numdns)</td></tr>
<tr class="separator:gad02111a6b26b93f1c3580d5f41a59af3"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a9389f374ec66488aa4f42a652583f533"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="dns_8c.html#a9389f374ec66488aa4f42a652583f533">dns_tmr</a> (void)</td></tr>
<tr class="separator:a9389f374ec66488aa4f42a652583f533"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ga1e040ec38166dc9bfcc3473aab0c799f"><td class="memItemLeft" align="right" valign="top"><a class="el" href="group__infrastructure__errors.html#gaf02d9da80fd66b4f986d2c53d7231ddb">err_t</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__dns.html#ga1e040ec38166dc9bfcc3473aab0c799f">dns_gethostbyname</a> (const char *hostname, <a class="el" href="group__ipaddr.html#ga16ef96d6cde029029bbf47fee35fd67a">ip_addr_t</a> *addr, <a class="el" href="dns_8h.html#ab5a9dec5b22802f91876c53e99f427ae">dns_found_callback</a> found, void *callback_arg)</td></tr>
<tr class="separator:ga1e040ec38166dc9bfcc3473aab0c799f"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:gae84449f60dca6b863142daca8e03ce79"><td class="memItemLeft" align="right" valign="top"><a class="el" href="group__infrastructure__errors.html#gaf02d9da80fd66b4f986d2c53d7231ddb">err_t</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__dns.html#gae84449f60dca6b863142daca8e03ce79">dns_gethostbyname_addrtype</a> (const char *hostname, <a class="el" href="group__ipaddr.html#ga16ef96d6cde029029bbf47fee35fd67a">ip_addr_t</a> *addr, <a class="el" href="dns_8h.html#ab5a9dec5b22802f91876c53e99f427ae">dns_found_callback</a> found, void *callback_arg, u8_t dns_addrtype)</td></tr>
<tr class="separator:gae84449f60dca6b863142daca8e03ce79"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table>
<a name="details" id="details"></a><h2 class="groupheader">Detailed Description</h2>
<div class="textblock"><p>DNS - host name to IP address resolver. </p>
</div><h2 class="groupheader">Macro Definition Documentation</h2>
<a id="a7f5553dc4a0d2bf99ba1282a86df31e2"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a7f5553dc4a0d2bf99ba1282a86df31e2">&#9670;&nbsp;</a></span>DNS_MAX_TTL</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">#define DNS_MAX_TTL&#160;&#160;&#160;604800</td>
        </tr>
      </table>
</div><div class="memdoc">
<p>DNS resource record max. TTL (one week as default) </p>

</div>
</div>
<a id="a97f3b0c56aeee091fdf2f07faf864ce0"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a97f3b0c56aeee091fdf2f07faf864ce0">&#9670;&nbsp;</a></span>DNS_PORT_ALLOWED</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">#define DNS_PORT_ALLOWED</td>
          <td>(</td>
          <td class="paramtype">&#160;</td>
          <td class="paramname">port</td><td>)</td>
          <td>&#160;&#160;&#160;((port) &gt;= 1024)</td>
        </tr>
      </table>
</div><div class="memdoc">
<p>Limits the source port to be &gt;= 1024 by default </p>

</div>
</div>
<a id="a9209c204996270af5cfdfd6e391267a1"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a9209c204996270af5cfdfd6e391267a1">&#9670;&nbsp;</a></span>DNS_RAND_TXID</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">#define DNS_RAND_TXID&#160;&#160;&#160;<a class="el" href="group__compiler__abstraction.html#ga77370c377781ee7489e30eaf772ea05a">LWIP_RAND</a></td>
        </tr>
      </table>
</div><div class="memdoc">
<p>Random generator function to create random TXIDs and source ports for queries </p>

</div>
</div>
<h2 class="groupheader">Function Documentation</h2>
<a id="adb31c3b6180773bd11f914c327f209cf"></a>
<h2 class="memtitle"><span class="permalink"><a href="#adb31c3b6180773bd11f914c327f209cf">&#9670;&nbsp;</a></span>dns_init()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void dns_init </td>
          <td>(</td>
          <td class="paramtype">void&#160;</td>
          <td class="paramname"></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">
<p>Initialize the resolver: set up the UDP pcb and configure the default server (if DNS_SERVER_ADDRESS is set). </p>

</div>
</div>
<a id="a9389f374ec66488aa4f42a652583f533"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a9389f374ec66488aa4f42a652583f533">&#9670;&nbsp;</a></span>dns_tmr()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void dns_tmr </td>
          <td>(</td>
          <td class="paramtype">void&#160;</td>
          <td class="paramname"></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">
<p>The DNS resolver client timer - handle retries and timeouts and should be called every DNS_TMR_INTERVAL milliseconds (every second by default). </p>

</div>
</div>
</div><!-- contents -->
</div><!-- doc-content -->
<!-- start footer part -->
<div id="nav-path" class="navpath"><!-- id is needed for treeview function! -->
  <ul>
    <li class="navelem"><a class="el" href="dir_68267d1309a1af8e8297ef4c3efbcdba.html">src</a></li><li class="navelem"><a class="el" href="dir_aebb8dcc11953d78e620bbef0b9e2183.html">core</a></li><li class="navelem"><a class="el" href="dns_8c.html">dns.c</a></li>
    <li class="footer">Generated by
    <a href="http://www.doxygen.org/index.html">
    <img class="footer" src="doxygen.png" alt="doxygen"/></a> 1.8.13 </li>
  </ul>
</div>
</body>
</html>
